<template>
	<view>
		<input v-model="form.beizhu" placeholder="好友备注"/>
		
		<textarea v-model="form.info" placeholder="请输入验证信息"/>
		
		<view style="width: 100%; display: flex; justify-content: center;">
			<button style="width: 80%;" @click="sendFriendRequest">发送申请</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					tid: null,
					beizhu: "",
					info: ""
				}
			};
		},
		onLoad(options) {
			//console.log(options.tid);
			this.form.tid = options.tid;
		},
		methods: {
			sendFriendRequest() {
				this.$.ajax({
					type: 'POST',
					data: this.form,
					url: '/friendsRequest/insert',
					success: (res) => {
						//console.log("添加好友发送成功");
						uni.showToast({
							title: '添加好友请求已发送'
						});
					}
				});
			}
		}
	}
</script>

<style lang="scss">
input {
		margin: 40rpx;
		padding: 20rpx 40rpx;
		box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
		border-radius: 20rpx;
	}
	
	textarea {
		margin: 40rpx;
		padding: 20rpx 40rpx;
		box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
		border-radius: 20rpx;
	}
	
	button {
		margin: 0px;
		background-color: #00A2FF;
		color: white;
		border: 0px;
		box-shadow: 10rpx 10rpx 10rpx gray;
	}
	
	
	button:active {
		background-color: #3ab4ff;
		position: relative;
		left: 5rpx;
		top: 5rpx;
		box-shadow: 5rpx 5rpx 10rpx gray;
	}
</style>
